# coding: utf-8

from wtforms import StringField, SubmitField
from wtforms.validators import Optional
from wtforms_components import DateTimeField

from .constant import CallState

from ..forms import WphForm, NonValidatingSelectField, NotChoices


class SearchOutboundForm(WphForm):
    """
    搜索外呼记录表单
    """

    call_state = NonValidatingSelectField(
        '外呼状态',
        choices=NotChoices + [i for i in CallState.to_options() if i[0] > 0],
        validators=[Optional()], default=NotChoices[0][0]
    )
    admin_nickname = StringField('客服昵称', validators=[Optional()])
    call_time_begin = DateTimeField('最早外呼时间', validators=[Optional()],)
    call_time_end = DateTimeField('最晚外呼时间', validators=[Optional()],)
    submit = SubmitField('查询')
